package com.eupmt.lab3.controllers.impl;

import com.eupmt.lab3.controllers.ITipusReparacioController;
import com.eupmt.lab3.domain.TipusReparacio;
import com.eupmt.lab3.persistence.ibatis.dao.TipusReparacioDaoManager;
import com.eupmt.lab3.utils.Log;
import java.util.List;

/**
 *
 * @author Edu Sirvent
 */
public class TipusReparacioController implements ITipusReparacioController {

    //Atributes
   protected static TipusReparacioController instance = null;
    TipusReparacioDaoManager dao = null;
    private Log log = null;


    //Constructors
    private TipusReparacioController() {
        log = new Log();
    }


   public void saveTipusReparacio(TipusReparacio tipus) throws Exception {
      throw new UnsupportedOperationException("Not supported yet.");
   }
   
    public void insertTipusReparacio(TipusReparacio tipus) throws Exception {
        dao = TipusReparacioDaoManager.getInstance();
        dao.insertTipusReparacio(tipus);
    }

    public void updateTipusReparacio(TipusReparacio tipus) throws Exception {
        dao = TipusReparacioDaoManager.getInstance();
        dao.updateTipusReparacio(tipus);
    }

    public void deleteTipusReparacio(TipusReparacio tipus) throws Exception {
        dao = TipusReparacioDaoManager.getInstance();
        dao.deleteTipusReparacio(tipus);
    }
    
    public TipusReparacio getTipusReparacioById(Integer id) throws Exception {
        dao = TipusReparacioDaoManager.getInstance();
        return dao.getTipusReparacioById(id);
    }

   public List<TipusReparacio> getAllTipusReparacio() throws Exception {
      throw new UnsupportedOperationException("Not supported yet.");
   }




   // Patro Singleton
   public static TipusReparacioController getInstance() {
      if (instance == null) {
         instance = new TipusReparacioController();
      }
      return instance;
   }
}
